#include <iostream>
#include <string>
#include <cstdio> 
using namespace std;
#define N 1010
int ans[N];

int main()
{
	int t;
	cin>>t;
	int jishu=1;
	int record=t;
	while(t--){
		string stra,strb;
		cin>>stra>>strb;
		memset(ans,0,sizeof(ans));
		int indexa,indexb;
		indexa=stra.length()-1;
		indexb=strb.length()-1;
		int num=indexa<indexb?indexb:indexa;
		int jinwei=0;
		int t1,t2;
		t1=int(stra[indexa]-'0');
		t2=int(strb[indexb]-'0');
		for(int i=0;i<num+1;i++){
			int temp=ans[i]+t1+t2;
			ans[i]=temp%10;
			ans[i+1]=temp/10;
			indexa--;
			indexb--;
			if(indexa<0) t1=0;
			else t1=int(stra[indexa]-'0');
			if(indexb<0) t2=0;
			else t2=int(strb[indexb]-'0');
		}
		
		int i;
		for(i=num+1;i>=0;i--)
			if(ans[i]!=0) break;
		printf("Case %d:",jishu);
		cout<<endl;
		cout<<stra<<" + "<<strb<<" = ";
		for(;i>=0;i--) printf("%d",ans[i]);
		if(jishu!=record) printf("\n\n");
		else printf("\n");
		jishu++;	
	}
	return 0;
} 
